package com.schoolvisitors.repository;

import com.schoolvisitors.entity.Floor;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

public interface FloorRepository extends JpaRepository<Floor, Long> {
    List<Floor> findByOrderByNumberAsc();

    boolean existsByName(String name);

    boolean existsByNumber(Short number);

    List<Floor> findAllByDeleteFalse();

    Optional<Floor> findByIdAndDeleteFalse(Long floorId);
}
